<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j">
    <head>
        <title>TODO supply a title</title>
    </head>
    <body>
        <ui:composition>
            <h:form>
                <rich:panel styleClass="content-hight">
                    <a4j:commandButton id="budget" value="预算审批" rendered="false"/>
                    <a4j:commandButton id="plan" value="计划审批" rendered="false"/>
                    <a4j:commandButton id="exec" value="执行审批" rendered="false"/>
                    <rich:jQuery selector="#budget" event="click" query="jQuery('#tableGroup').css('display','block')"/>

                    <a4j:commandButton value="查看待审批单据" action="#{unCheckViewBean.query}" render="@form"/>
                    <hr/>
                    <h:panelGroup id="tableGroup" style="margin-bottom: 10px;">
                        <fieldset>
                            <legend>预算审批</legend>  
                            <rich:extendedDataTable id="editTable"
                                                    value="#{budgetCheckGovBean.viewList}" var="emp"
                                                    rowClasses="list-row-odd,list-row-even"
                                                    rowKeyVar="rowKey"
                                                    headerClass="table-header"
                                                    noDataLabel="无数据!" rows="5"
                                                    frozenColumns="2"
                                                    style="width:740px;margin-bottom: 20px;">
                                <rich:column width="40px" style="text-align:center">
                                    <f:facet name="header">序号</f:facet>
                                        #{rowKey+1}
                                </rich:column>
                                <rich:column width="40px" style="text-align:center">
                                    <f:facet name="header">操作</f:facet>
                                    <h:commandLink  action="#{budgetCheckGovBean.selectedFromView(emp)}">
                                        <h:outputText value="审批" rendered="#{emp.status eq '1'}"/>
                                        <h:outputText value="查看"  rendered="#{emp.status eq '2' or emp.status eq '3'}"/>
                                    </h:commandLink>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">资金性质</f:facet>
                                    <h:outputText value="基本" rendered="#{emp.quality eq '0'}"/>
                                    <h:outputText value="项目" rendered="#{emp.quality eq '1'}"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">预算类型</f:facet>
                                    <h:outputText value="新增" rendered="#{emp.addSign eq '0'}" style="color: green;"/>
                                    <h:outputText value="追加" rendered="#{emp.addSign eq '1'}" style="color: blue;"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">类别</f:facet>
                                    <h:outputText value="#{emp.planWay}">
                                    </h:outputText>
                                </rich:column>
                                <rich:column rendered="#{budgetCheckGovBean.quality =='1' or empty budgetCheckGovBean.quality}" >
                                    <f:facet name="header">项目</f:facet>
                                    <h:outputText value="#{emp.project.finName}"/>
                                    <h:outputText value="--" rendered="#{empty emp.project.finName}" />
                                </rich:column>
                                <rich:column style="width:100px;white-space: nowrap;">
                                    <f:facet name="header">部门</f:facet>
                                    <h:outputText value="#{emp.deptName}"/>
                                </rich:column>
                                <rich:column style="width:100px;white-space: nowrap;">
                                    <f:facet name="header">处室</f:facet>
                                    <h:outputText value="#{emp.officeName}"/>
                                </rich:column>
                                <rich:column style="width:100px;white-space: nowrap;">
                                    <f:facet name="header">编报人</f:facet>
                                    <h:outputText value="#{emp.editPerName}"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">状态</f:facet>
                                    <h:outputText value="待审核" rendered="#{emp.status == '1'}" style="color:blue;"/>
                                    <h:outputText value="审核通过" rendered="#{emp.status == '3'}" style="color:green"/>
                                    <h:outputText value="退回修改" rendered="#{emp.status == '2'}" style="color:red"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">品目</f:facet>
                                    <h:outputText value="#{emp.cate.name}"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">计量单位</f:facet>
                                    <h:outputText value="#{emp.cate.unit}"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">采购数量</f:facet>
                                    <h:outputText value="#{emp.cate.count}"/>
                                </rich:column>
                                <rich:column style="text-align: right;width:120px">
                                    <f:facet name="header">财政性资金</f:facet>
                                    <h:outputText value="#{emp.financial}">
                                        <f:convertNumber type="number" pattern="#,##0.00"/>
                                    </h:outputText>
                                </rich:column>
                                <rich:column style="text-align:right;width:120px">
                                    <f:facet name="header">其他资金</f:facet>
                                    <h:outputText value="#{emp.other}">
                                        <f:convertNumber type="number" pattern="#,##0.00"/>
                                    </h:outputText>
                                </rich:column>
                                <rich:column rendered="false">
                                    <f:facet name="header">组织形式</f:facet>
                                    <h:outputText value="集中采购" rendered="#{emp.organizeForm == '0'}"/>
                                    <h:outputText value="部门集中采购" rendered="#{emp.organizeForm == '1'}"/>
                                    <h:outputText value="分散采购" rendered="#{emp.organizeForm == '2'}"/>
                                </rich:column>
                                <rich:column rendered="false">
                                    <f:facet name="header">委托的集中采购机构</f:facet>
                                    <h:outputText value="#{emp.organ}"/>
                                </rich:column>
                                <rich:column rendered="false">
                                    <f:facet name="header">采购方式</f:facet>
                                    <h:outputText value="公开招标" rendered="#{emp.cateWay == '0'}"/>
                                    <h:outputText value="邀请招标" rendered="#{emp.cateWay == '1'}"/>
                                    <h:outputText value="竞争性谈判" rendered="#{emp.cateWay == '2'}"/>
                                    <h:outputText value="单一来源" rendered="#{emp.cateWay == '3'}"/>
                                    <h:outputText value="询价" rendered="#{emp.cateWay == '4'}"/>
                                </rich:column>

                                <f:facet name="footer"/>
                            </rich:extendedDataTable>
                        </fieldset>
                    </h:panelGroup>
                    <h:panelGroup id="tableGroup2" style="margin-bottom: 10px;">
                        <fieldset>
                            <legend>计划审批</legend>
                            <rich:dataScroller for="editTable2" execute="@this" render="tableGroup2"/>
                            <div style="width:750px;max-height:350px;overflow:auto;">
                                <rich:extendedDataTable id="editTable2"
                                                        value="#{planCheckGovBean.viewList}" var="emp"
                                                        rowClasses="list-row-odd,list-row-even" rowKeyVar="rowKey"
                                                        headerClass="table-header"
                                                        noDataLabel="无数据!" rows="5"
                                                        frozenColumns="2"
                                                        style="width:740px;margin-bottom: 20px;">
                                    <rich:column width="40px" style="text-align:center">
                                        <f:facet name="header">序号</f:facet>
                                            #{rowKey+1}
                                    </rich:column>
                                    <rich:column width="40px" style="text-align:center">
                                        <f:facet name="header">操作</f:facet>
                                        <h:commandLink  action="#{planCheckGovBean.selectedFromView(emp)}">
                                            <h:outputText value="审批" rendered="#{emp.status == '1'}"/>
                                            <h:outputText value="查看"  rendered="#{emp.status == '2' or emp.status =='3'}"/>
                                        </h:commandLink>
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">资金性质</f:facet>
                                        <h:outputText value="基本" rendered="#{emp.quality eq '0'}"/>
                                        <h:outputText value="项目" rendered="#{emp.quality eq '1'}"/>
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">预算类型</f:facet>
                                        <h:outputText value="新增" rendered="#{emp.addSign eq '0'}" style="color: green;"/>
                                        <h:outputText value="追加" rendered="#{emp.addSign eq '1'}" style="color: blue;"/>
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">类别</f:facet>
                                        <h:outputText value="#{emp.planWay}">
                                        </h:outputText>
                                    </rich:column>
                                    <rich:column style="text-align:center" rendered="#{planCheckGovBean.quality =='1' or empty planCheckGovBean.quality}" >
                                        <f:facet name="header">项目</f:facet>
                                        <h:outputText value="#{emp.project.finName}"/>
                                        <h:outputText value="--" rendered="#{empty emp.project.finName}" />
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">编号</f:facet>
                                        <h:outputText value="#{emp.number}"/>
                                    </rich:column>
                                    <rich:column rendered="false">
                                        <f:facet name="header">状态</f:facet>
                                        <h:outputText value="待审核"  rendered="#{emp.status == '1'}" style="color:blue"/>
                                        <h:outputText value="审核通过"  rendered="#{emp.status == '3'}" style="color:green"/>
                                        <h:outputText value="退回修改"  rendered="#{emp.status == '2'}" style="color:red"/>
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">品目</f:facet>
                                        <h:outputText value="#{emp.cate.name}"/>
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">计量单位</f:facet>
                                        <h:outputText value="#{emp.cate.unit}"/>
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">采购数量</f:facet>
                                        <h:outputText value="#{emp.cate.count}"/>
                                    </rich:column>
                                    <rich:column style="text-align: right;width:120px">
                                        <f:facet name="header">财政性资金</f:facet>
                                        <h:outputText value="#{emp.financial}">
                                            <f:convertNumber type="number" pattern="#,##0.00"/>
                                        </h:outputText>
                                    </rich:column>
                                    <rich:column style="text-align:right;width:120px">
                                        <f:facet name="header">其他资金</f:facet>
                                        <h:outputText value="#{emp.other}">
                                            <f:convertNumber type="number" pattern="#,##0.00"/>
                                        </h:outputText>
                                    </rich:column>
                                    <rich:column rendered="false">
                                        <f:facet name="header">组织形式</f:facet>
                                        <h:outputText value="集中采购" rendered="#{emp.organizeForm == '0'}"/>
                                        <h:outputText value="部门集中采购" rendered="#{emp.organizeForm == '1'}"/>
                                        <h:outputText value="分散采购" rendered="#{emp.organizeForm == '2'}"/>
                                    </rich:column>
                                    <rich:column rendered="false">
                                        <f:facet name="header">委托的集中采购机构</f:facet>
                                        <h:outputText value="#{emp.organ}"/>
                                    </rich:column>
                                    <rich:column rendered="false">
                                        <f:facet name="header">采购方式</f:facet>
                                        <h:outputText value="公开招标" rendered="#{emp.cateWay == '0'}"/>
                                        <h:outputText value="邀请招标" rendered="#{emp.cateWay == '1'}"/>
                                        <h:outputText value="竞争性谈判" rendered="#{emp.cateWay == '2'}"/>
                                        <h:outputText value="单一来源" rendered="#{emp.cateWay == '3'}"/>
                                        <h:outputText value="询价" rendered="#{emp.cateWay == '4'}"/>
                                    </rich:column>

                                    <f:facet name="footer"/>
                                </rich:extendedDataTable>
                            </div>
                        </fieldset>
                    </h:panelGroup>
                    <h:panelGroup id="tableGroup3" style="margin-bottom: 10px;">
                        <fieldset>
                            <legend>执行审批</legend>
                            <rich:extendedDataTable id="editTable3"
                                                    value="#{executCheckBean.viewList}" var="emp"
                                                    rowClasses="list-row-odd,list-row-even"
                                                    rowKeyVar="rowKey"
                                                    headerClass="table-header"
                                                    noDataLabel="无数据!" rows="5"
                                                    frozenColumns="2"                                                    
                                                    style="width:740px;margin-bottom: 20px;">
                                <rich:column width="40px" style="text-align: center;">
                                    <f:facet name="header">序号</f:facet>
                                        #{rowKey+1}
                                </rich:column>
                                <rich:column width="40px" style="text-align:center">
                                    <f:facet name="header">操作</f:facet>
                                    <h:commandLink  action="#{executCheckBean.selectedFromView(emp)}">
                                        <h:outputText value="审批" rendered="#{emp.status == '1'}"/>
                                        <h:outputText value="查看"  rendered="#{emp.status == '2' or emp.status =='3'}"/>
                                        <a4j:param value="#{rowKey}" assignTo="#{executCheckBean.curIndex}"/>
                                    </h:commandLink>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">类别</f:facet>
                                    <h:outputText value="#{emp.planWay}">
                                    </h:outputText>
                                </rich:column>
                                <rich:column style="text-align:center" rendered="#{executCheckBean.quality =='1' or empty executCheckBean.quality}" >
                                    <f:facet name="header">项目</f:facet>
                                    <h:outputText value="#{emp.project.finName}"/>
                                    <h:outputText value="--" rendered="#{empty emp.project.finName}" />
                                </rich:column>
                                <rich:column rendered="false">
                                    <f:facet name="header">状态</f:facet>
                                    <h:outputText value="待审核"  rendered="#{emp.status == '1'}" style="color:blue"/>
                                    <h:outputText value="审核通过"  rendered="#{emp.status == '3'}" style="color:green"/>
                                    <h:outputText value="退回修改"  rendered="#{emp.status == '2'}" style="color:red"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">品目</f:facet>
                                    <h:outputText value="#{emp.cate.name}"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">计量单位</f:facet>
                                    <h:outputText value="#{emp.cate.unit}"/>
                                </rich:column>
                                <rich:column>
                                    <f:facet name="header">采购数量</f:facet>
                                    <h:outputText value="#{emp.cate.count}"/>
                                </rich:column>
                                <rich:column style="text-align: right;width:120px">
                                    <f:facet name="header">财政性资金</f:facet>
                                    <h:outputText value="#{emp.financial}">
                                        <f:convertNumber type="number" pattern="#,##0.00"/>
                                    </h:outputText>
                                </rich:column>
                                <rich:column style="text-align:right;width:120px">
                                    <f:facet name="header">其他资金</f:facet>
                                    <h:outputText value="#{emp.other}">
                                        <f:convertNumber type="number" pattern="#,##0.00"/>
                                    </h:outputText>
                                </rich:column>
                                <rich:column rendered="false">
                                    <f:facet name="header">组织形式</f:facet>
                                    <h:outputText value="集中采购" rendered="#{emp.organizeForm == '0'}"/>
                                    <h:outputText value="部门集中采购" rendered="#{emp.organizeForm == '1'}"/>
                                    <h:outputText value="分散采购" rendered="#{emp.organizeForm == '2'}"/>
                                </rich:column>
                                <rich:column rendered="false">
                                    <f:facet name="header">委托的集中采购机构</f:facet>
                                    <h:outputText value="#{emp.organ}"/>
                                </rich:column>
                                <rich:column rendered="false">
                                    <f:facet name="header">采购方式</f:facet>
                                    <h:outputText value="公开招标" rendered="#{emp.cateWay == '0'}"/>
                                    <h:outputText value="邀请招标" rendered="#{emp.cateWay == '1'}"/>
                                    <h:outputText value="竞争性谈判" rendered="#{emp.cateWay == '2'}"/>
                                    <h:outputText value="单一来源" rendered="#{emp.cateWay == '3'}"/>
                                    <h:outputText value="询价" rendered="#{emp.cateWay == '4'}"/>
                                </rich:column>
                                <rich:column style="text-align:center"
                                             rendered="false">
                                    <f:facet name="header">附加备注</f:facet>
                                    <a4j:commandLink value="【查看】" action="#{executCheckBean.selectdExAppend}"
                                                     onclick="#{rich:component('appendPanel')}.show()"
                                                     render="editGridAppend" />
                                </rich:column>

                                <f:facet name="footer"/>
                            </rich:extendedDataTable>
                        </fieldset>              
                    </h:panelGroup>
                </rich:panel>
            </h:form>

            <rich:popupPanel id="appendPanel" autosized="true" width="600" height="200">
                <f:facet name="header">附加备注信息</f:facet>
                <f:facet name="controls">
                    <h:outputLink value="#" onclick="#{rich:component('appendPanel')}.hide();
                                                             return false;">关闭</h:outputLink>
                </f:facet>
                <h:form>
                    <rich:panel>
                        <h:panelGroup id="tableGroupa">
                            <h:panelGrid id="editGridAppend" columns="4" width="100%" style="text-align:left;">
                                <h:outputLabel value="购入日期："/>                   
                                <h:outputText value="#{executCheckBean.exappend.date1}">
                                    <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                                </h:outputText>

                                <h:outputLabel value="质保日期："/>
                                <h:outputText value="#{executCheckBean.exappend.date2}">
                                    <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                                </h:outputText>

                                <h:outputLabel value="资产名称："/>
                                <h:outputText value="#{executCheckBean.exappend.content1}" />

                                <h:outputLabel value="品牌："/>
                                <h:outputText value="#{executCheckBean.exappend.content2}"/>

                                <h:outputLabel value="厂商："/>
                                <h:outputText value="#{executCheckBean.exappend.content3}"/>

                                <h:outputLabel value="规格型号："/>
                                <h:outputText value="#{executCheckBean.exappend.content4}"/>
                            </h:panelGrid>
                        </h:panelGroup>
                    </rich:panel>
                </h:form>
            </rich:popupPanel>
            <rich:popupPanel id="checkInfoPanel" autosized="true" width="500" height="500">
                <f:facet name="header">项目列表</f:facet>
                <f:facet name="controls">
                    <h:outputLink value="#" onclick="#{rich:component('checkInfoPanel')}.hide();
                                                             return false;">关闭</h:outputLink>
                </f:facet>
                <h:form>
                    <rich:panel id="infoPanel">
                        <ui:include src="/page/checkflow/checkInfo.xhtml"/>
                    </rich:panel>
                </h:form>
            </rich:popupPanel>
        </ui:composition>
    </body>
</html>
